package org.hzz.promotions.types.vo;

import com.alibaba.fastjson2.annotation.JSONField;
import io.gitee.pkmer.fastjson2.enums.BaseEnumWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hzz.promotions.types.enums.coupon.DiscountType;

import java.time.LocalDateTime;

/**
 * @author <a href="mailto:1193094618@qq.com">pkmer</a>
 * <br>
 * <a href = "https://gitee.com/developeros/videos-online">Code Repository</a>
 * At 2024/9/4
 */
@Data
@Schema(description = "用户领取的优惠券")
public class UserCouponVo {

    @Schema(description = "优惠券ID")
    private Long id;

    @Schema(description = "优惠券名称")
    private String name;

    @Schema(description = "折扣类型",example = "1")
    @JSONField(serializeUsing = BaseEnumWriter.class)
    private DiscountType discountType;

    @Schema(description = "是否限定作用范围",example = "true")
    private Boolean specific;

    @Schema(description = "折扣值")
    private Integer discountValue;

    @Schema(description = "使用门槛，0：表示无门槛，其他值：最低消费金额",example = "100")
    private Integer thresholdAmount;

    @Schema(description = "最高优惠金额，满减最大，0：表示没有限制，不为0，则表示该券有金额的限制",example = "100")
    private Integer maxDiscountAmount;

    @Schema(description = "优惠券有效期天数",example = "30")
    private Integer termDays;

    @Schema(description = "优惠券有效期结束时间")
    private LocalDateTime termEndTime;
}
